url ='/account/order/update-shipping-address/:id'
layout='default'

[session]
security = "user"
redirect = "account/login"
==
function onStart(){
    $this['redirect'] = URL::previous() ?: '/';
}
==
<div class="shipping_content">
		<!-- breadcrumbs -->
		<div class="breadcrumbs">
			<div class="container">
				<ul>
					<li class="fl" ><a href="/">KOKOMI</a></li>
					<li class="fl" >荷物のお届け先</li>
				</ul>
			</div>
		</div>
		<!-- breadcrumbs end -->
		<div class="shippingCont">
			<div class="container">
				<h2 class="pageHead1">荷物のお届け先</h2>
				<div class="ov dashboardBox">
					<div class="fl d_sidemenus">
						{% partial 'account/left-bar' %}
					</div>
					<div class="fr d_main">
						<div class="main-ttl">荷物のお届け先</div>
						<div class="change-elements">
							<p class="lead">
								荷物を迅速に間違いなくお客様のお手元に届けるように、以下の内容を必ず正しく入力してください。
			                </p>

			                {% set address = catalog.getAddress(this.param.id) %}



							<form class="form-horizontal" data-request="onUpdateAddress" data-request-redirect="{{ redirect }}">
			                <table class="shippingContTable">
			                	<tbody>			                		
			                		<tr>
			                			<th>お名前</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
											<input style="display: none;" type="text" class="form-control" name="address_id" id="address_id"
												   value= '{{ address.id ? address.id : 0 }}'>
			                				<input type="text" required name="first_name" value="{{ address.first_name ? address.first_name : '' }}" title="お名前" maxlength="15">
			                				<p class="ex">全角（例：阪急花子）</p>
			                			</td>
			                		</tr>
			                		<tr>
			                			<th>お名前（フリガナ）</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				<input type="text" required name="last_name" value="{{ address.last_name ? address.last_name : '' }}" title="お名前（フリガナ）" maxlength="15">
			                				<p class="ex">全角カタカナ（例：ハンキュウハナコ）</p>
			                			</td>
			                		</tr>
			                		
			                		
			                		<tr>
										<th>電話番号</th>
										<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
										<td class="input-element">        
											<input maxlength="3" pattern="[0-9]{3}" name="phone0"  value="{{ address.phone0 ? address.phone0 : '' }}" type="text" required style="width: 20%;" class="input-phone">
											<span style="padding: 10px">-</span>        
											<input name="phone1"  value="{{ address.phone1 ? address.phone1 : '' }}" type="text" required style="width: 20%;" maxlength="4" pattern="[0-9]{4}" class="input-phone">
											<span style="padding: 10px">-</span>        
											<input name="phone2"  value="{{ address.phone2 ? address.phone2 : '' }}" type="text" required style="width: 20%;" maxlength="4" pattern="[0-9]{4}" class="input-phone">  
											<p class="ex">（例）090-1234-5678</p>
										</td>
									</tr>

									<tr>
										<th>固定電話</th>
										<td class="icon"></td>
										<td class="input-element">                
											<input maxlength="3" pattern="[0-9]{3}" name="tel"  value="{{ address.tel ? address.tel : '' }}" type="text" style="width: 20%;" class="input-telephone">
											<span style="padding: 10px">-</span>        
											<input name="tel1"  value="{{ address.tel1 ? address.tel1 : '' }}" type="text" style="width: 20%;" maxlength="3" pattern="[0-9]{3}" class="input-mark-tel">
											<span style="padding: 10px">-</span>        
											<input name="tel2"  value="{{ address.tel2 ? address.tel2 : '' }}" type="text" style="width: 20%;" maxlength="4" pattern="[0-9]{4}">        
											<p class="ex">（例）086-123-4567</p>
										</td>
									</tr>
			                		
			                		<tr>
			                			<th>郵便番号</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				<input type="text" required name="zip" value="{{ address.zip ? address.zip : '' }}" class="short" title="郵便番号" maxlength="15" onKeyUp="AjaxZip3.zip2addr(this,'','state_id','city','address');">
			                				<!--<p class="ex">半角数字</p>-->
			                				<p class="attentions">
						                        <a class="colrBlue" target="_blank" href="http://www.post.japanpost.jp/zipcode/" shape="rect">郵便番号が分からない方はこちら</a>
			                                    <!--<br clear="none">※郵便番号をご入力後、郵便番号検索ボタンを押してください。住所が自動で入力されます。<br clear="none">
			                                    ※海外の方は999-9999をご入力ください。-->
						                     </p>
			                			</td>
			                		</tr>
									<tr>
										<th>国</th>
										<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
										<td class="input-element">
											{{ form_select_country('country_id',
											catalog.getUserInput('country_id') ? catalog.getUserInput('country_id') : 122, {
											id: 'country_id',
											class: 'newSelect',
											emptyOption: '国を選択してください',
											'data-request': 'onPullStateList',
											'data-request-loading': '#loading',
											'required': '',
											'data-request-success': 'afterChangeCountry($el, data, "state_id")'
											})
											}}
										</td>
									</tr>
			                		<tr>
			                			<th>都道府県</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				{{ form_select_state('state_id',
								            (address.country_id ? address.country_id : 122), (address.state_id ? address.state_id : 122), {
								            id: 'state_id',
								            class: 'newSelect',
								            'required': '',
								            }) }}
			                			</td>
			                		</tr>
			                		<tr>
			                			<th>市区郡</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				<input type="text" required name="city" value="{{ address.city ? address.city :'' }}" title="市区郡" maxlength="32">
			                				<p class="ex">例：大阪市北区</p>
			                			</td>
			                		</tr>
			                		<tr>
			                			<th>町村</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				<input type="text" required name="address" value="{{ address.address ? address.address : '' }}" title="町村" maxlength="32">
			                				<p class="ex">例：角田町</p>
			                			</td>
			                		</tr>
			                		<tr>
			                			<th>番地・マンション名</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				<input type="text" required name="address_detail" value="{{ address.address_detail ? address.address_detail : '' }}" title="番地・マンション名" maxlength="50">
			                				<p class="ex">例：８－７ 阪急マンション１０１号室</p>
			                			</td>
			                		</tr>
			                		<tr>
			                			<th>メールアドレス</th>
			                			<td class="icon"><img src="{{ 'assets/img/icon-must.gif'|theme }}" alt=""></td>
			                			<td class="input-element">
			                				<input type="text" required name="email" value="{{ address.email ? address.email : '' }}" title="メールアドレス" maxlength="100">
			                				<p class="ex">半角英数</p>
			                			</td>
			                		</tr>
			                	</tbody>
			                </table>
							<div class="btn-changed onBigBtn">
								<button type="submit">
									<img alt="マイページトップ" src="{{ 'assets/img/btn-confirm-change.jpg'|theme }}">
								</button>
							</div>
							</form>
						</div>

					</div>
				</div>
			</div>
		</div>
	</div>
<script src="https://ajaxzip3.github.io/ajaxzip3.js" charset="UTF-8"></script>